package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Date;

/**
 * 订单详情对象 rent_order
 *
 * @author ssd
 * @date 2024-04-18
 */
public class SysOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long orderId;

    /** 订单状态：0未成功，1成功 */
    @Excel(name = "订单状态：0未成功，1成功")
    private Integer status;

    /** 签约合同 */
    @Excel(name = "签约合同")
    private String contract;

    /** 其他相关信息 */
    @Excel(name = "其他相关信息")
    private String otherInfo;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;

    /** 租赁时长 */
    @Excel(name = "租赁时长")
    private String duration;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 总价 */
    @Excel(name = "总价")
    private BigDecimal totalPrice;
    /** 总价 */
    @Excel(name = "租客名称")
    private String orderUser;
    /** 总价 */
    @Excel(name = "租客电话")
    private String orderPhone;
    /** 合同对象 */
    @Excel(name = "房源信息", targetAttr = "property", type = Excel.Type.EXPORT)

    private SysProperty property;

    public SysProperty getProperty() {
        return property;
    }

    public void setProperty(SysProperty property) {
        this.property = property;
    }

    public void setOrderId(Long orderId)
    {
        this.orderId = orderId;
    }

    public Long getOrderId()
    {
        return orderId;
    }
    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }
    public void setContract(String contract)
    {
        this.contract = contract;
    }

    public String getContract()
    {
        return contract;
    }
    public void setOtherInfo(String otherInfo)
    {
        this.otherInfo = otherInfo;
    }

    public String getOtherInfo()
    {
        return otherInfo;
    }

    public void setCreatTime(Date creatTime) {
        this.creatTime = creatTime;
    }

    public void setDuration(String duration)
    {
        this.duration = duration;
    }

    public String getDuration()
    {
        return duration;
    }
    public void setStartTime(Date startTime)
    {
        this.startTime = startTime;
    }

    public Date getStartTime()
    {
        return startTime;
    }
    public void setEndTime(Date endTime)
    {
        this.endTime = endTime;
    }


    public Date getEndTime() {

        return endTime;
    }

    public void setTotalPrice(BigDecimal totalPrice)
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice()
    {

        return totalPrice;
    }

    public String getOrderUser() {
        return orderUser;
    }

    public void setOrderUser(String orderUser) {
        this.orderUser = orderUser;
    }

    public String getOrderPhone() {
        return orderPhone;
    }

    public void setOrderPhone(String orderPhone) {
        this.orderPhone = orderPhone;
    }

    public Date getCreatTime() {
        return creatTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("status", getStatus())
                .append("contract", getContract())
                .append("otherInfo", getOtherInfo())
                .append("creatTime", getCreatTime())
                .append("duration", getDuration())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("totalPrice", getTotalPrice())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .append("orderUser" , getOrderUser())
                .append("orderPhone" , getOrderPhone())
                .append("property" , getProperty())
                .toString();
    }
}
